package org.grow.actor.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "PurchaseBill")
public class PurchaseBill {
    @TableId(value = "billId", type = IdType.INPUT)
    private String billId;

    @TableField(value = "billState")
    private BillState billState = BillState.toSubmit ;

    @TableField(value = "supplier")
    private String supplier;

    @TableField(value = "orderDate")
    private LocalDateTime orderDate;

    @TableField(value = "receiveDate")
    private LocalDateTime receiveDate;

    @TableField(value = "amount")
    private BigDecimal amount =new BigDecimal(0);

    @TableField(value = "nextItemId")
    private Integer nextItemId = 0;

    @TableField(value = "applier")
    private String applier;

    @TableField(value = "applierTime")
    private LocalDateTime applierTime;

    @TableField(value = "auditor")
    private String auditor;

    @TableField(value = "auditTime")
    private LocalDateTime auditTime;

    @TableField(value = "auditMsg")
    private String auditMsg;

    @TableField(value = "history")
    private String history;

    @TableField(value = "updateTime")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private List<PurchaseItem> items = new ArrayList<>();

    public static final String COL_BILLID = "billId";

    public static final String COL_BILLSTATE = "billState";

    public static final String COL_SUPPLIER = "supplier";

    public static final String COL_ORDERDATE = "orderDate";

    public static final String COL_RECEIVEDATE = "receiveDate";

    public static final String COL_AMOUNT = "amount";

    public static final String COL_NEXTITEMID = "nextItemId";

    public static final String COL_APPLIER = "applier";

    public static final String COL_APPLIERTIME = "applierTime";

    public static final String COL_AUDITOR = "auditor";

    public static final String COL_AUDITTIME = "auditTime";

    public static final String COL_AUDITMSG = "auditMsg";

    public static final String COL_HISTORY = "history";

    public static final String COL_UPDATETIME = "updateTime";
}